#include "clientgui.h"
#include <QtWidgets/QApplication>
#include <QJsonArray>
#include <QJsonValue>
#include <QJsonObject>
#include <QDebug>

QJsonValue getValue(const QJsonObject &qObj, const QString &qstrKey)
{
	QJsonValue qjval = qObj.value(qstrKey);
	return qjval;
}

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
#if 0
	{
		qDebug() << "1";
		QJsonObject obj;
		QJsonArray arr;
		for (int i = 0; i < 100000; i++) {
			QJsonObject obj;
			obj["text"] = "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111";
			arr.append(obj);
		}
		obj["arr"] = arr;
		QJsonArray arr2 = arr;
		QJsonArray arr3 = obj["arr"].toArray();
		qDebug() << "2";
		for (QJsonArray::const_iterator itor = arr.constBegin(); itor != arr.constEnd(); ++itor) {
			const QJsonObject &in = itor->toObject();
			QString vvv = getValue(in, "text").toString();
		}

		qDebug() << "3";
		for (QJsonArray::const_iterator itor = arr.begin(); itor != arr.end(); ++itor) {
			const QJsonObject &in = itor->toObject();
			QString vvv = getValue(in, "text").toString();
		}
		qDebug() << "3";
	}
#endif

    clientgui w;
    w.show();
    return a.exec();
}
